import React from 'react'
// ===================================================================== Temp
// import FormModal from '#cpt/temp/FormModal'
// ===================================================================== global declare
// ===================================================================== Declare
const { $Lazy } = window
// ===================================================================== Lazy
const Modal 			= $Lazy.state(()=>import('@antd/modal'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		SD: '',
		CV: ''
	}
	
	open = (row, levels) => {
		let SD = ''
		let CV = ''
		for (let i = 1; i <= levels; i++) {
			SD += `[水平${i}] ${row[`level${i}_sd`] ? row[`level${i}_sd`] : '--'}  `
			CV += `[水平${i}] ${row[`level${i}_cv`] ? row[`level${i}_sd`] : '--'}  `
		}
		this.setState({SD, CV})
		this.modalRef.open()
	}
	
	render(){
		const { SD, CV } = this.state
		return <Modal
			title	= '信息'
			width 	= {400}
			height  = '40%'
			// okText	= '测试'
			noOk
			// noCancel
			noText 	= '关闭'
			onRef	= { ref => this.modalRef = ref }
			isFullScroll
			onOk	= { () => {
				
			} }
			close	= { () => {
			}}
		>
			<div className='h fv p-modal'>
				<div className='fxm'>
					<span className='b' style={{width:100}}>浮动均值/SD：</span>
					<span>{SD}</span>
				</div>
				<div className='fxm mt15'>
					<span className='b' style={{width:100}}>变异系数：</span>
					<span>{CV}</span>
				</div>
			</div>
		</Modal>
	}
}

export default Index